package com.googlecode.kipler.satisfiability.completion.rule.individual.uniformnotation;

import com.googlecode.kipler.syntax.LTLUnaryOperator;
import com.googlecode.kipler.syntax.concept.Concept;
import com.googlecode.kipler.syntax.concept.LTLUnaryConcept;


public class AlwaysAlphaConcept implements AlphaConcept {

	private LTLUnaryConcept unCon;

	private Concept alpha1, alpha2;

	private boolean valid;

	public AlwaysAlphaConcept() {
		super();
	}

	public AlwaysAlphaConcept(Concept concept) {
		setAlpha(concept);
	}

	@Override
	public void setAlpha(Concept concept) {
		valid = false;
		if (concept instanceof LTLUnaryConcept) {
			unCon = (LTLUnaryConcept) concept;
			if (unCon.getConstructor() == LTLUnaryOperator.ALWAYS) {
				alpha1 = unCon.getOperand();
				alpha2 = new LTLUnaryConcept(LTLUnaryOperator.NEXT, unCon);
				valid = true;
			}
		}
	}

	@Override
	public Concept getAlpha1() {
		return alpha1;
	}

	@Override
	public Concept getAlpha2() {
		return alpha2;
	}

	public boolean isValid() {
		return valid;
	}
}
